package com.cyf.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 基础配置
 * Created by cage on 2017/2/13.
 */
@Component
@ConfigurationProperties
public class BasicProperties {

    @Value("${server.port}")    // https端口
    private int serverPort;
    @Value("${server.address}")     // 应用请求地址。为了app测试方便（用户获取头像）
    private String serverAddress;
    @Value("${http.port}")      // http端口
    private int httpPort;
    @Value("${http.url.patterns}")  // http的请求
    private String[] httpUrlPatterns;
    @Value("${https.url.patterns}") // https的请求
    private String[] httpsUrlPatterns;

    @Value("${swagger.show}")       // 是否显示swagger文档
    private boolean swaggerShow;
    @Value("${swagger.patterns}")   // 显示指定的api
    private String[] swaggerPatterns;

    @Value("${app.urls.image}")     // app主页中的图片的url
    private String[] appImageUrls;
    @Value("${app.filepath.version}")   // app版本文件存放位置
    private String appVersionFilePath;
    @Value("${app.filepath.apk}")   // app的apk存放位置
    private String appApkFilePath;
    @Value("${app.filepath.jar}")   // app的jar存放位置
    private String appJarFilePath;

    @Value("${app.filepath.merchant.version}")   // app版本文件存放位置
    private String appVersionFilePathForMerchant;
    @Value("${app.filepath.merchant.apk}")   // app的apk存放位置
    private String appApkFilePathForMerchant;
    @Value("${app.filepath.handset.version}")   // app版本文件存放位置
    private String appVersionFilePathForHandset;
    @Value("${app.filepath.handset.apk}")   // app的apk存放位置
    private String appApkFilePathForHandset;

    @Value("${app.filepath.svrapp.version}")
    private String svrAppVersionFile; //service App version file

    @Value("${app.filepath.svrapp.apk}")// service App Apk file
    private String appApkFilePathForSvrApp;

    @Value("${app.filepath.auth}")  // app车辆认证的图片存放位置
    private String appAuthFilePath;
    @Value("${illegal.cert.path}")  // app违章查询的证书路径
    private String illegalCertPath;
    @Value("${illegal.cert.pwd}")   // app违章查询的证书密码
    private String illegalCertPwd;
    @Value("${app.filepath.portrait}")   // app用户头像保存路径
    private String appPortraitFilePath;
    @Value("${app.urls.portrait}")      // app用户默认头像
    private String appUserDefaultPortrait;

    /* 队列消息缓存时间 */
    private long mqCacheTime = 5;   // 秒

    /* app网络超时时间 */
    private long appNetworkTimeOut = 6;   // 秒

    public int getServerPort() {
        return serverPort;
    }

    public void setServerPort(int serverPort) {
        this.serverPort = serverPort;
    }

    public int getHttpPort() {
        return httpPort;
    }

    public void setHttpPort(int httpPort) {
        this.httpPort = httpPort;
    }

    public String[] getHttpUrlPatterns() {
        return httpUrlPatterns;
    }

    public void setHttpUrlPatterns(String[] httpUrlPatterns) {
        this.httpUrlPatterns = httpUrlPatterns;
    }

    public String[] getHttpsUrlPatterns() {
        return httpsUrlPatterns;
    }

    public void setHttpsUrlPatterns(String[] httpsUrlPatterns) {
        this.httpsUrlPatterns = httpsUrlPatterns;
    }

    public boolean getSwaggerShow() {
        return swaggerShow;
    }

    public void setSwaggerShow(boolean swaggerShow) {
        this.swaggerShow = swaggerShow;
    }

    public String[] getSwaggerPatterns() {
        return swaggerPatterns;
    }

    public void setSwaggerPatterns(String[] swaggerPatterns) {
        this.swaggerPatterns = swaggerPatterns;
    }

    public String[] getAppImageUrls() {
        return appImageUrls;
    }

    public void setAppImageUrls(String[] appImageUrls) {
        this.appImageUrls = appImageUrls;
    }

    public String getAppVersionFilePath() {
        return appVersionFilePath;
    }

    public void setAppVersionFilePath(String appVersionFilePath) {
        this.appVersionFilePath = appVersionFilePath;
    }

    public String getAppApkFilePath() {
        return appApkFilePath;
    }

    public void setAppApkFilePath(String appApkFilePath) {
        this.appApkFilePath = appApkFilePath;
    }

    public String getSvrAppVersionFile() {
        return svrAppVersionFile;
    }

    public void setSvrAppVersionFile(String svrAppVersionFile) {
        this.svrAppVersionFile = svrAppVersionFile;
    }

    public String getAppApkFilePathForSvrApp() {
        return appApkFilePathForSvrApp;
    }

    public void setAppApkFilePathForSvrApp(String appApkFilePathForSvrApp) {
        this.appApkFilePathForSvrApp = appApkFilePathForSvrApp;
    }

    public String getAppJarFilePath() {
        return appJarFilePath;
    }

    public void setAppJarFilePath(String appJarFilePath) {
        this.appJarFilePath = appJarFilePath;
    }

    public String getIllegalCertPath() {
        return illegalCertPath;
    }

    public void setIllegalCertPath(String illegalCertPath) {
        this.illegalCertPath = illegalCertPath;
    }

    public String getIllegalCertPwd() {
        return illegalCertPwd;
    }

    public void setIllegalCertPwd(String illegalCertPwd) {
        this.illegalCertPwd = illegalCertPwd;
    }

    public String getAppAuthFilePath() {
        return appAuthFilePath;
    }

    public void setAppAuthFilePath(String appAuthFilePath) {
        this.appAuthFilePath = appAuthFilePath;
    }

    public long getMqCacheTime() {
        return mqCacheTime;
    }

    public void setMqCacheTime(long mqCacheTime) {
        this.mqCacheTime = mqCacheTime;
    }

    public long getAppNetworkTimeOut() {
        return appNetworkTimeOut;
    }

    public void setAppNetworkTimeOut(long appNetworkTimeOut) {
        this.appNetworkTimeOut = appNetworkTimeOut;
    }

    public String getAppPortraitFilePath() {
        return appPortraitFilePath;
    }

    public void setAppPortraitFilePath(String appPortraitFilePath) {
        this.appPortraitFilePath = appPortraitFilePath;
    }

    public String getAppUserDefaultPortrait() {
        return appUserDefaultPortrait;
    }

    public void setAppUserDefaultPortrait(String appUserDefaultPortrait) {
        this.appUserDefaultPortrait = appUserDefaultPortrait;
    }

    public String getServerAddress() {
        return serverAddress;
    }

    public void setServerAddress(String serverAddress) {
        this.serverAddress = serverAddress;
    }

    public String getAppVersionFilePathForMerchant() {
        return appVersionFilePathForMerchant;
    }

    public void setAppVersionFilePathForMerchant(String appVersionFilePathForMerchant) {
        this.appVersionFilePathForMerchant = appVersionFilePathForMerchant;
    }

    public String getAppApkFilePathForMerchant() {
        return appApkFilePathForMerchant;
    }

    public void setAppApkFilePathForMerchant(String appApkFilePathForMerchant) {
        this.appApkFilePathForMerchant = appApkFilePathForMerchant;
    }

    public String getAppVersionFilePathForHandset() {
        return appVersionFilePathForHandset;
    }

    public void setAppVersionFilePathForHandset(String appVersionFilePathForHandset) {
        this.appVersionFilePathForHandset = appVersionFilePathForHandset;
    }

    public String getAppApkFilePathForHandset() {
        return appApkFilePathForHandset;
    }

    public void setAppApkFilePathForHandset(String appApkFilePathForHandset) {
        this.appApkFilePathForHandset = appApkFilePathForHandset;
    }


}
